package org.wu.framework.authorization.platform.controller;


import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.wu.framework.authorization.platform.config.TitleProperties;
import org.wu.framework.authorization.platform.domain.model.sys.SysTitleInfo;
import org.wu.framework.web.response.Result;
import org.wu.framework.web.response.ResultFactory;
import org.wu.framework.web.spring.EasyController;

@Slf4j
@Tag(name = "Title信息维护者")
@EasyController("/v1/api/title")
public class SysTitleProvider {

    @Resource
    private TitleProperties titleProperties;

    /**
     * 获取标题信息
     * @return
     */
    @GetMapping("/info")
    public Result<SysTitleInfo> info() {
        SysTitleInfo sysTitleInfo = new SysTitleInfo();
        sysTitleInfo.setName(this.titleProperties.getName());
        sysTitleInfo.setWechatKeyWord(this.titleProperties.getWechatKeyWord());
        sysTitleInfo.setWechatVerificationCode(this.titleProperties.getWechatVerificationCode());
        sysTitleInfo.setEnabled(this.titleProperties.getEnabled());
        return ResultFactory.successOf(sysTitleInfo);
    }

}
